{% extends 'wsite.html' %}

{% import 'bootstrap/wtf.html' as wtf %}

{% block page_name %} production list  {% endblock %}

{% block page_content %}
    <div class="page-header">
        <h2>productions List</h2>
    </div>
    <div class="wsite-pager">
        <form name="searchForm" id="searchForm" role="form" method="post">
            <div class="form-inline">
                <div class="form-group">
                    {{ wtf.form_field(form.name) }}
                </div>
                <div class="form-group">
                    {{ wtf.form_field(form.submit) }}
                    <a type="button" class="btn btn-primary" href="{{ url_for('seed.add_production') }}">add</a>
                </div>
            </div>
        </form>

        <h2></h2>

        <div class="table-responsive">
            <table class="table table-bordered table-hover">
                <thead>
                <tr>
                    <th>#</th>
                    <th>cover image</th>
                    <th>production</th>
                    <th>publish time</th>
                    <th>category</th>
                    <th>type</th>
                    <th>seed count</th>
                    <th>created time</th>
                    <th>updated time</th>
                    <th>operate</th>
                </tr>

                </thead>
                <tbody>
                {% for product in productions_page.items %}
                    <tr>
                        <td>{{ loop.index }}</td>
                        <td>
                            <img src="{{ product.cover_uri }}" alt="no image" class="img-rounded" style="max-width: 120px; max-height: 160px">
                        </td>
                        <td>{{ product.name }}</td>
                        <td>{{ product.pub_time }}</td>
                        <td>{{ product.category }}</td>
                        <td>{{ product.type }}</td>
                        <td>{{ product.seed_count }}</td>
                        <td>{{ product.created_time }}</td>
                        <td>{{ product.updated_time }}</td>
                        <td>
                            <a href="{{ url_for('seed.seed_list', pid=product.id) }}"><span
                                    class="glyphicon glyphicon-pencil"></span></a>
                            &nbsp;
                            <a href="{{ url_for('seed.search_production_seed', pid=product.id) }}" title="search seed" data-toggle="tooltip" data-placement="bottom">
                                <span class="glyphicon glyphicon-search"></span>
                            </a>
                            &nbsp;
                            <a href="#"><span class="glyphicon glyphicon-trash"></span></a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
{% endblock %}

